#!/bin/sh
# Job yaml can send below ENVIRONMENT VARIABLES to me
# - cmdline
# - delay
# - oneshot
# - interval
# END ENVIRONMENT VARIABLES

: "${interval:=1}"

. "$LKP_SRC"/lib/wait.sh
setup_wait

[ -n "$delay" ] && wait_timeout "$delay"

while true; do
	echo time: "$(date +%s.%N)"
	$cmdline
	[ -n "$oneshot" ] && exit 0
	wait_timeout "$interval"
done
